#coding=utf-8

import uuid
from langconv import *

def Simplified2Traditional(sentence):
    '''
    将sentence中的简体字转为繁体字
    :param sentence: 待转换的句子
    :return: 将句子中简体字转换为繁体字之后的句子
    '''
    sentence = Converter('zh-hant').convert(sentence)
    return sentence

if __name__=="__main__":
    simplified_sentence = '忧郁的台湾乌龟'
    traditional_sentence = Simplified2Traditional(simplified_sentence)
    print(traditional_sentence)

    with open("banned_words.txt", "r",encoding="utf-8") as f:
        with open("insert_trad.sql","w+",encoding="utf8") as ff:
            ff.write("insert into symphony_option(oId,optionValue,optionCategory) values ")
            for con in f:
                #ff.write("(\""+uuid.uuid1().__str__()+"\",\""+con.strip()+"\",\"reserved-words\"),\n")
                ff.write("(\""+uuid.uuid1().__str__()+"\",\""+Simplified2Traditional(con.strip())+"\",\"reserved-words\"),\n")
            ff.write(";")